package com.hinnotek.amoeba.repo

import com.hinnotek.amoeba.api.ApiService
import com.hinnotek.amoeba.base.BaseBean
import com.hinnotek.amoeba.bean.old.AmibaTemporaryeByIdBean
import com.hinnotek.amoeba.bean.old.AmibaTemporaryePageByUserIdBean
import com.hinnotek.amoeba.bean.old.SellPurchaseRequistionBean
import com.hinnotek.amoeba.bean.old.SellPurchaseRequistionDetailBean
import com.lee.common.base.BaseRepository
import com.lee.common.network.net.StateLiveData
import okhttp3.RequestBody
import javax.inject.Inject

class AmibaRepo  @Inject constructor(private val service: ApiService) : BaseRepository() {

    /**
     * app端获取合同列表分页接口
     */
    suspend fun updateAmibaReimburse(body: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.updateAmibaReimburse(body) }, stateLiveData)
    }

    suspend fun getAmibaTemporaryeById(amibaTemporaryId: Int, stateLiveData: StateLiveData<AmibaTemporaryeByIdBean>) {
        executeResp({ service.getAmibaTemporaryeById(amibaTemporaryId) }, stateLiveData)
    }

    suspend fun getAmibaPurchaseById(amibaPurchaseId: Int, stateLiveData: StateLiveData<SellPurchaseRequistionDetailBean>) {
        executeResp({ service.getAmibaPurchaseById(amibaPurchaseId) }, stateLiveData)
    }

    suspend fun updateAmibaPurchase(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.updateAmibaPurchase(requestBody) }, stateLiveData)
    }

    suspend fun backAmibaPurchase(amibaPurchaseId: Int, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.backAmibaPurchase(amibaPurchaseId) }, stateLiveData)
    }

    suspend fun resubmitAmibaPurchase(amibaPurchaseId: Int, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.resubmitAmibaPurchase(amibaPurchaseId) }, stateLiveData)
    }

    suspend fun getAmibaPurchaseType1ByUserId(requestBody: RequestBody, stateLiveData: StateLiveData<MutableList<SellPurchaseRequistionBean>>) {
        executeResp({ service.getAmibaPurchaseType1ByUserId(requestBody) }, stateLiveData)
    }

    suspend fun getAmibaPurchaseType2ByUserId(requestBody: RequestBody, stateLiveData: StateLiveData<MutableList<SellPurchaseRequistionBean>>) {
        executeResp({ service.getAmibaPurchaseType2ByUserId(requestBody) }, stateLiveData)
    }

    suspend fun getAmibaPurchaseType3ByUserId(requestBody: RequestBody, stateLiveData: StateLiveData<MutableList<SellPurchaseRequistionBean>>) {
        executeResp({ service.getAmibaPurchaseType3ByUserId(requestBody) }, stateLiveData)
    }

    suspend fun addAmibaTemporary(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.addAmibaTemporary(requestBody) }, stateLiveData)
    }

    suspend fun getAmibaTemporaryePageByUserId(requestBody: RequestBody, stateLiveData: StateLiveData<MutableList<AmibaTemporaryePageByUserIdBean>>) {
        executeResp({ service.getAmibaTemporaryePageByUserId(requestBody) }, stateLiveData)
    }

    suspend fun addAmibaPurchaseSale(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.addAmibaPurchaseSale(requestBody) }, stateLiveData)
    }

    suspend fun addAmibaPurchaseTechnology(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.addAmibaPurchaseTechnology(requestBody) }, stateLiveData)
    }

    suspend fun addAmibaPurchaseDevelop(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.addAmibaPurchaseTechnology(requestBody) }, stateLiveData)
    }

    suspend fun updateAmibaPurchaseProject(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.updateAmibaPurchaseProject(requestBody) }, stateLiveData)
    }


}